package com.zego.wawaji.ui.bean.wawa.Game;

import android.os.Parcel;
import android.os.Parcelable;

import com.zego.wawaji.base.data.BaseData;

import org.json.JSONObject;

/**
 * 游戏info
 * Created by Su on 2017/12/4.
 */
public class Game extends BaseData implements Parcelable {
    private long gameId;    // 游戏id, 服务端做游戏结算用

    @Override
    public void parseJson(String jsonStr) {
        JSONObject jsonObject = getJsonObject(jsonStr);
        this.gameId = jsonObject.optLong("GameId");
    }

    public long getGameId() {
        return gameId;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeLong(this.gameId);
    }

    public Game() {
    }

    protected Game(Parcel in) {
        this.gameId = in.readLong();
    }

    public static final Creator<Game> CREATOR = new Creator<Game>() {
        @Override
        public Game createFromParcel(Parcel source) {
            return new Game(source);
        }

        @Override
        public Game[] newArray(int size) {
            return new Game[size];
        }
    };
}
